package org.apache.solr.client;

import java.text.SimpleDateFormat;
import java.util.Collection;

import org.apache.solr.client.exception.SolrClientException;
import org.apache.solr.client.exception.SolrServerException;

public interface SolrClient 
{
	// Standard Date format used in solr
	public static final SimpleDateFormat ISO8601_UTC = new SimpleDateFormat( "yyyy-MM-dd'T'hh:mm:ss,SSS'Z'" );

	public abstract void add( final SolrDocumentable doc) throws SolrClientException, SolrServerException;
	public abstract void add( final Collection<SolrDocumentable> documents) throws SolrClientException, SolrServerException;

	public abstract void delete(final String id) throws SolrClientException, SolrServerException;

	public abstract void deleteByQuery(final String query) throws SolrClientException, SolrServerException;

	public abstract void commit(boolean waitFlush, boolean waitSearcher) throws SolrClientException,SolrServerException;
	public abstract void optimize(boolean waitFlush, boolean waitSearcher) throws SolrClientException, SolrServerException;

	public abstract QueryResults query( final SolrQuery query ) throws SolrClientException, SolrServerException;
}